UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uN42Dl2SHjSDgTcz5SV4O5uGQnC7iBubTnroTEzll3M='
WHERE
key_id = '27b6135b6ffc03b98956bf0dc805f1a23ec2d5858f4aff813ad48b71807b3414'
AND (
token = 'uN42Dl2SHjSDgTcz5SV4O5uGQnC7iBubTnroTEzll3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)