UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uTjX/HcVHK1tHBv3Sn5cuYU2Ka6177qprAVVpXNF9Vo=' 
WHERE 
  key_id = 'd46b474f9f135ac949c3c3c6d72d5fa1b316ac0146dc2ab6bd5379fb3814e080' 
  AND (
    token = 'uTjX/HcVHK1tHBv3Sn5cuYU2Ka6177qprAVVpXNF9Vo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031