UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EoazjQoustfeAKs5b/9zQX+wzKA/HA1kUECsjyjSI08='
WHERE
key_id = '4d80ec05a109f8d4af758b85fdef316a1b817c5f607988b9645d1b064d2b7def'
AND (
token = 'EoazjQoustfeAKs5b/9zQX+wzKA/HA1kUECsjyjSI08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)