UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZGh/iRNylQm/ZwEy3aqsXL4D0xXL6M+ZgljTE1117lU=' 
WHERE 
  key_id = '381e57221385232d3399c6597d71434b2a9ef851e59c1f09af7299b3edaef681' 
  AND (
    token = 'ZGh/iRNylQm/ZwEy3aqsXL4D0xXL6M+ZgljTE1117lU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033