UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ERAHvq1PDQEXypqqsNO9+RwZB8YufMsrraS00Xln6HI=' 
WHERE 
  key_id = 'ce9a214355d9fe34a070891b550cccc9b30c6271686ba38399f70735a13e8651' 
  AND (
    token = 'ERAHvq1PDQEXypqqsNO9+RwZB8YufMsrraS00Xln6HI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052