UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vo/03/K6So2HGkDC/wh4MUfMu64ESXhJuI5t7+YM+vU=' 
WHERE 
  key_id = '4ffa9739204b1f3a8c2b5b905a2148bac6effb8bed48f13fa46a94ea6b0d8fa9' 
  AND (
    token = 'vo/03/K6So2HGkDC/wh4MUfMu64ESXhJuI5t7+YM+vU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035