UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WlDcDRro/bfVU2FQtcvMRNh608SfBOyG0RIjhhFmLuQ=' 
WHERE 
  key_id = '522df469311133a001d071fc8ea95136662ee263998ae6b7d9d689c38f87a565' 
  AND (
    token = 'WlDcDRro/bfVU2FQtcvMRNh608SfBOyG0RIjhhFmLuQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027