UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/MBd7YEus7F9jEoFrxWscL/TSzQbYQ07v69WmveSA4='
WHERE
key_id = 'd175cd6da1adbc54306c27e934df7cc52a79c0127eb1676789c26e17f95ac2f8'
AND (
token = 'a/MBd7YEus7F9jEoFrxWscL/TSzQbYQ07v69WmveSA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)