UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BpDkjPrA/zBmG1tDsTO6Fa04wO4f4SVsg22V1cu1HgY='
WHERE
key_id = '192ceaa5fd33ca8cefe860a1bedde80732dbbb9609f96293769a031bcaa54c7a'
AND (
token = 'BpDkjPrA/zBmG1tDsTO6Fa04wO4f4SVsg22V1cu1HgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)