UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tb7ob4gC9/LdtV1jLsCgYq761qTM6qE9Sh4Y1jJ0LQw='
WHERE
key_id = 'e173127a6f74b10c71721b57b8d48c68b15c9272b9477638fa3961d500405b68'
AND (
token = 'tb7ob4gC9/LdtV1jLsCgYq761qTM6qE9Sh4Y1jJ0LQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)