UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uGpC/vue5vLeiB25/R9QopYirYSGbmtlUhjpJuk/CNI=' 
WHERE 
  key_id = 'cca7f9cc96ade9c54f085f5274f6b0f3d241263c326264a310fb03f596ba2f94' 
  AND (
    token = 'uGpC/vue5vLeiB25/R9QopYirYSGbmtlUhjpJuk/CNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020