UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XEsbbqnmapTs7HyV7DBwVsWnfweq5cQp9qInc3pROGw=' 
WHERE 
  key_id = '738213079130b4a7b2c6e8406f78219e83e527fa1c5d3d431705a3fd1b0cef64' 
  AND (
    token = 'XEsbbqnmapTs7HyV7DBwVsWnfweq5cQp9qInc3pROGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037