UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '095fzMFo10xh12iOHzae/N9kcMKrz9utyHijCLSDdy4=' 
WHERE 
  key_id = '4be4f899a6c2d0f85e1d96fbc73106ca3492ec39a43197ce18d3cc6f050e5625' 
  AND (
    token = '095fzMFo10xh12iOHzae/N9kcMKrz9utyHijCLSDdy4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022