UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GCAe4bHYENCi8+AKDGLIGIkKjHwWoHM/74/QlGMM5gY=' 
WHERE 
  key_id = 'adddff940bcf4b7e35ac4b46c4615afada0ac911b1e08fdaa989d2a36db72b29' 
  AND (
    token = 'GCAe4bHYENCi8+AKDGLIGIkKjHwWoHM/74/QlGMM5gY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030