UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mKdZ7HKY49V5h4Znn93GkJecl9NQM3DBrKlmCw9b70I='
WHERE
key_id = 'bd2c383b06f2bff3f66ba35bc350bc9b9ff199d7b03f669dce4e57812953bc80'
AND (
token = 'mKdZ7HKY49V5h4Znn93GkJecl9NQM3DBrKlmCw9b70I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)