UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TLIaMpsTE1lWYiekLEVXYib0tXNAINQU7/kodcxvneo='
WHERE
key_id = 'dbeac8f11bc8702ddc296ead730b8d2be3ea2e28a3eb34277b23c335007905fd'
AND (
token = 'TLIaMpsTE1lWYiekLEVXYib0tXNAINQU7/kodcxvneo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)