UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zVnKl+JGOfN4dQZD9I3GCr5VupBu6p4QAiWl6FT3Y4='
WHERE
key_id = 'd3dbe854bf3285cfad9b71d49e066a898d4997b1f6b814e52eeb7ddee6ae7160'
AND (
token = '4zVnKl+JGOfN4dQZD9I3GCr5VupBu6p4QAiWl6FT3Y4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)