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