UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zPjtygSEz9ibNHGhwx982/EdyM0Mr03M+sVaSI/7zJk='
WHERE
key_id = '78e366695385a969e920d0ca6508d1c2a549520b8eae7484e8e857a3d3cf682d'
AND (
token = 'zPjtygSEz9ibNHGhwx982/EdyM0Mr03M+sVaSI/7zJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)