UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5lhvu1JeMSWAo6wCCRKniXF1hwwJHkOZemy6Gg5nNCo=' 
WHERE 
  key_id = 'fe546e937d8dfb4d50acec4abb1caac726c2e7f4a7b1e917080a88c2242aea8b' 
  AND (
    token = '5lhvu1JeMSWAo6wCCRKniXF1hwwJHkOZemy6Gg5nNCo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020