UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/eQ/s9a28ybT+cD5Kv4ffCPGNfJfR/7fVTb90B+aoSQ='
WHERE
key_id = 'd58f2cb2dd44cdc0edbabd645f2a1f5e797deca1fa4a1c16371eb0d7634fe43d'
AND (
token = '/eQ/s9a28ybT+cD5Kv4ffCPGNfJfR/7fVTb90B+aoSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)