UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YDD6SM9HDXqL6FIZ1m/rNOvoQ+ncR+nVj84CH9hqd6k='
WHERE
key_id = 'e03d23c201b623bea8af6e81b0f662a75765a202f6cf7668d8026833ac2e2269'
AND (
token = 'YDD6SM9HDXqL6FIZ1m/rNOvoQ+ncR+nVj84CH9hqd6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)