UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3TfEqXEVaMuVcn6tdYThssEkW9alK+vw9MlGuHDYEpQ='
WHERE
key_id = 'a21e39f29de59e9e0b4c2faf29c860316c0569e2e59c048c4d2df59951179ab6'
AND (
token = '3TfEqXEVaMuVcn6tdYThssEkW9alK+vw9MlGuHDYEpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)