UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HWaZyIAaX+nnhLH+rCb6cdTw2sxR5SwmLnxAEEA6IwI='
WHERE
key_id = 'cf5277d7c7a76c852927d671322dbab12c5b2aa1bdab635b254c87e88f0f37da'
AND (
token = 'HWaZyIAaX+nnhLH+rCb6cdTw2sxR5SwmLnxAEEA6IwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)