UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y+aC+wsqlsjo6wOy2xw/Q2hpBHTD9S3RFTTeRoEO1ww=' 
WHERE 
  key_id = 'a4e2fa1810a19133039dd8d3823dc3b78f4492b711935f5ed9b80751beff65f9' 
  AND (
    token = 'y+aC+wsqlsjo6wOy2xw/Q2hpBHTD9S3RFTTeRoEO1ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030