UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XaKH0mZ1DyWPsZ05sGlK/Ypjrb3kYei6NqWvb6+e1Pw=' 
WHERE 
  key_id = 'e7b4b0008dad32375766b3de064a8d804ce1318da4863815cbdc489652cca685' 
  AND (
    token = 'XaKH0mZ1DyWPsZ05sGlK/Ypjrb3kYei6NqWvb6+e1Pw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032