UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '36G8qjvsJ36ieZR617OzAEmOekQjrJYMEyo41xwT2Pc=' 
WHERE 
  key_id = '94f5675b4246f47f417470643257ba29735715b26fd97432934cd80066c8af88' 
  AND (
    token = '36G8qjvsJ36ieZR617OzAEmOekQjrJYMEyo41xwT2Pc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030