UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K1x0Xyo1Wnm2er0JzwUdEhY266sPH3Q0qiHQC+bZDU0=' 
WHERE 
  key_id = 'a4aee14ba59ee5b1f1a03fb09debd595d12f7286df18216c3f0a697d810cfac9' 
  AND (
    token = 'K1x0Xyo1Wnm2er0JzwUdEhY266sPH3Q0qiHQC+bZDU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052