UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XCu6KGibt/fDgtUL5+ih7hELKzdp80FzwD3P8r5Y20c=' 
WHERE 
  key_id = 'b50faf848ea9a1523e202ab8ea2b8f09c5e766e847be9642ea73eb7d2dfcc132' 
  AND (
    token = 'XCu6KGibt/fDgtUL5+ih7hELKzdp80FzwD3P8r5Y20c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043