UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D93ky8pDSOcCCV1uHMIREwCY18YLBIpe+qyMCIkT6yY=' 
WHERE 
  key_id = 'efeb772d843e3965859660e56d15db7b099d2f86a5f610b98d94443295188134' 
  AND (
    token = 'D93ky8pDSOcCCV1uHMIREwCY18YLBIpe+qyMCIkT6yY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047