UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'peDF6IxyJBTOGzAePnKeTKH8cI0lJlSIdsOYfl3rT0U=' 
WHERE 
  key_id = 'cb337fa7a027d19f8f693dcf172c082e91992800c0d722ec04c68abcbce86d19' 
  AND (
    token = 'peDF6IxyJBTOGzAePnKeTKH8cI0lJlSIdsOYfl3rT0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022