UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PFen4gfAhfSNYTaT9S5OMWZfVITq1FrdOdf6HhW/SNI=' 
WHERE 
  key_id = '04a18578f506abc4d3ed7a9597d53535c082e52b568a66c1340a9a6b6f7a748c' 
  AND (
    token = 'PFen4gfAhfSNYTaT9S5OMWZfVITq1FrdOdf6HhW/SNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016