UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zuHEd9yJV55NZFhmif3Ni6qjwZ0XGd2H0QO96NWUl5Q=' 
WHERE 
  key_id = '2dd15032014d513f7af3ca9ef33592517f6d5d5e8ffbfae0354af7ef8537c617' 
  AND (
    token = 'zuHEd9yJV55NZFhmif3Ni6qjwZ0XGd2H0QO96NWUl5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019