UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VqLczKl0jtsPANB0uPz0+WhZtUpA4LL45QQsuVToAz4='
WHERE
key_id = 'f99db62fddd24cef13943786384f01f81990a99c1efcb23c5a5077dc04209359'
AND (
token = 'VqLczKl0jtsPANB0uPz0+WhZtUpA4LL45QQsuVToAz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)